/**
 * 
 */
package denaris.factory;

/**
 * @author stkl23
 *
 */
public class FrameFactory {
	public static int[] createSequence(int from, int to, int delay) {
		int[] result = new int[(to - from + 1) * delay];
		int c = 0;
		for (int i=from; i<=to; i++) {
			for (int j=0; j<delay; j++) {
				result[c++] = i;
			}
		}
		
		return result;
	}
	
	public static int[] createLoopbackSequence(int from, int to, int delay) {
		int[] result = new int[((to - from ) << 1) * delay];
		int c = 0;
		for (int i=from; i<=to; i++) {
			for (int j=0; j<delay; j++) {
				result[c++] = i;
			}
		}
		for (int i=to-1; i > from; i--) {
			for (int j=0; j<delay; j++) {
				result[c++] = i;
			}
		}
		
		return result;
	}
}
